/*
 * Copyright (c) 2022 上海市政工程设计研究总院(集团)有限公司 All Rights Reserved.
 */
package com.smedi.ismedi.progress.core.port.adapter.convert;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smedi.ismedi.constructionproject.api.dto.request.ProjectListQueryRequest;
import com.smedi.ismedi.constructionproject.api.dto.response.resp.ProjectResp;
import com.smedi.ismedi.file.dto.response.FileInfoResponse;
import com.smedi.ismedi.inmail.api.dto.request.*;
import com.smedi.ismedi.inmail.api.dto.response.ProcessTaskResponse;
import com.smedi.ismedi.notification.api.dto.request.SendSmsRequest;
import com.smedi.ismedi.organization.api.dto.request.OrganizationListQueryRequest;
import com.smedi.ismedi.organization.api.dto.request.OrganizationOneQueryRequest;
import com.smedi.ismedi.personnel.api.dto.request.PersonListQueryRequest;
import com.smedi.ismedi.personnel.api.dto.response.resp.PersonDetailResp;
import com.smedi.ismedi.personnel.api.dto.response.resp.PersonResp;
import com.smedi.ismedi.progress.api.dto.request.*;
import com.smedi.ismedi.progress.api.dto.response.*;
import com.smedi.ismedi.progress.core.application.command.*;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.*;
import com.smedi.ismedi.progress.core.domain.dto.OrganizationQuery;
import com.smedi.ismedi.progress.core.domain.dto.PersonQuery;
import com.smedi.ismedi.progress.core.domain.dto.ProjectBriefReportVo;
import com.smedi.ismedi.progress.core.domain.dto.ProjectQuery;
import com.smedi.ismedi.progress.core.port.adapter.persistence.model.*;
import com.smedi.ismedi.web.starter.common.PaginationData;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

import java.util.List;

/**
 * 维修内容 Infrastructure Converter
 *
 * @author 15428
 * &#064;date  2022-06-07 15:22:03
 * @since 0.0.1
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface AdapterConverter {

    File fileInfoResponseToFile(FileInfoResponse fileInfoResponse);

    List<File> fileInfoResponseToFile(List<FileInfoResponse> fileInfoResponses);

    PersonListQueryRequest personQueryToPersonListQueryRequest(PersonQuery personQuery);

    @Mapping(source = "lastName", target = "name")
    Person personRespToPerson(PersonResp personResp);

    List<Person> personRespToPerson(List<PersonResp> personResps);

    ProjectListQueryRequest projectQueryToProjectListQueryRequest(ProjectQuery projectQuery);

    @Mapping(source = "projectName", target = "name")
    @Mapping(source = "projectShortName", target = "shortName")
    Project projectRespToProject(ProjectResp projectResp);

    ProcessInstanceStartRequest processInstanceStartCommandToProcessInstanceStartRequest(ProcessInstanceStartCommand processInstanceStartCommand);

    ProcessTask processTaskResponseToProcessTask(ProcessTaskResponse processTaskResponse);

    ProcessTaskCompleteRequest processTaskCompleteCommandToProcessTaskCompleteRequest(ProcessTaskCompleteCommand processTaskCompleteCommand);

    @Mapping(source = "urlOut", target = "url")
    FileResponse fileToFileResponse(File file);

    @Mapping(source = "mobiles", target = "receivers")
    SendSmsRequest sendMessageCommandToSendSmsRequest(MessageSendCommand messageSendCommand);

    ProcessTaskCancelRequest processTaskCancelCommandToProcessTaskCancelRequest(ProcessTaskCancelCommand processTaskCancelCommand);

    TaskRecordRequest taskRecordCreateCommandToTaskRecordRequest(TaskRecordCreateCommand taskRecordCreateCommand);

    TaskRecordRequest taskRecordEditCommandToTaskRecordRequest(TaskRecordEditCommand taskRecordEditCommand);

    List<VersionManageResponse> versionManageToVersionManageResponse(List<VersionManage> versionManages);

//---------

    PaginationData<VersionManageResponse> versionManageToVersionManageResponse(Page<VersionManage> versionManages);

    Page<VersionManage> versionManageEntityToVersionManage(Page<VersionManageEntity> versionManageEntities);

    PaginationData<ProgressResponse> progressPageToPaginationData(Page<Progress> progressPage);

    PaginationData<MilestoneResponse> milestonePageToPaginationData(Page<Progress> milestonePage);

    PaginationData<KeyTaskResponse> keyTaskPageToPaginationData(Page<Progress> keyTaskPage);

    Page<Progress> progressEntityPageToProgress(Page<ProgressEntity> progressEntityPage);

    List<MilestoneProgressDetail> progressDetailEntityListToProgressDetailList(List<ProgressDetailEntity> progressDetailEntityList);

    List<MilestoneDetailResponse> progressDetailListToMilestoneDetailListResponse(List<MilestoneProgressDetail> milestoneDetailList);


    Progress versionManageEntityToProgress(VersionManageEntity versionManageEntity);

    ProgressReviewProjectCommand progressReviewProjectRequestToProgressReviewProjectCommand(ProgressReviewProjectRequest progressReviewProjectRequest);

    VersionManageResponse progressToVersionManageResponse(Progress progress);

    VersionManageEntity ProgressToVersionManageEntity(Progress versionManage);

    VersionManageEntity versionManageCreateRequestToVersionManageEntity(VersionManageCreateRequest versionManageCreateRequest);

    ProgressViewCommand progressViewRequestToProgressViewCommand(ProgressViewRequest progressViewRequest);

    ProgressViewResponse progressViewToProgressViewResponse(ProgressView progressView);

    ProgressView progressEntityToProgressView(VersionManageEntity progressEntity);

    List<VersionDetail> versionDetailEntityToVersionDetail(List<VersionDetailEntity> versionDetails);

    List<VersionDetailResponse> versionDetailsToVersionDetailResponse(List<VersionDetail> versionDetail);

    ProgressDetail progressEntityToProgressDetail(ProgressEntity progressEntity);

    List<ProjectScheduleDetail> progressDetailEntityToProjectScheduleDetail(List<ProgressDetailEntity> progressDetailEntity);

    List<ScheduleDetailsResponse> progressDetailToScheduleDetailsResponse(List<ProjectScheduleDetail> projectScheduleDetail);

    ProgressScheduleDetailsResponse progressDetailToProgressScheduleDetailsResponse(ProgressDetail progressDetail);

    ProgressDetailCommand progressDetailRequestToprogressDetailCommand(ProgressDetailRequest progressDetailRequest);

    List<KanbanDetailsResponse> progressKanbanDetailsToKanbanDetailsResponse(List<KanbanDetails> kanbanDetails);

    ProgressKanbanDetailsResponse progressKanbanDetailsToProgressKanbanDetailsResponse(ProgressKanbanDetails progressKanbanDetails);

    List<MilestoneNodeResponse> progressKanbanDetailsToMilestoneNodeResponse(List<MilestoneNodeDetails> milestoneNodeDetails);

    ProgressKanbanDetails progressEntityToProgressKanbanDetails(ProgressEntity progressEntity);

    List<KanbanDetails> progressDetailEntityToKanbanDetails(List<ProgressDetailEntity> progressDetailEntity);

    List<MilestoneNodeDetails> progressDetailEntityToMilestoneNodeDetails(List<ProgressDetailEntity> progressDetailEntity);

    ProgressDetailEntity projectScheduleDetailPartToProgressDetailEntity(VersionDetailEntity v);

    ProgressDetailEntity bToProgressDetailEntity(VersionDetailEntity b);

    PaginationData<ProgressKanBanListResponse> progressPageToPaginationKanBanData(Page<Progress> progressPage);

    List<Progress> progressEntityListToProgressList(List<ProgressEntity> progressEntityList);

    List<ProgressKanBanLagProjectResponse> progressListToProgressKanBanLagProjectResponse(List<Progress> progressList);

    ProgressKanBanQuery progressKanBanRequestToProgressKanBanRequestQuery(ProgressKanBanRequest progressKanBanRequest);

   ProgressReportListQuery progressReportListRequestToProgressReportListQuery(ProgressReportListRequest progressReportListRequest);

    Page<ProgressReport> progressReportEntityListToProgressReport(Page<ProgressReportEntity> progressReportEntityList);

    PaginationData<ProgressReportListResponse> progressWeekReportListToProgressReportListResponse(Page<ProgressReport> progressWeekReportList);

    ProgressReportDetailEntity versionToProgressReportDetailEntity(VersionDetailEntity version);

    ProgressReportEntity weekReportToProgressReportEntity(ProgressReport weekReport);

    ProgressReport progressReportEntityToProgressReport(ProgressReportEntity progressReportEntity);

    ProgressReportExportQuery progressReportDetailRequestToProgressReportDetailQuery(ProgressReportDetailRequest progressReportExportRequest);

    ProgressReportMonthDetailAllResponse progressReportWeekToMonth(ProgressReportWeekDetailAllResponse progressReportWeekToMonth);

    WeekMonthReportResponse weekReportToWeekReportResponse(ProgressReport weekReport);

    ProgressWeekMonthReportCommand progressWeekMonthReportRequestToProgressWeekMonthReportCommand(ProgressWeekMonthReportRequest progressWeekMonthReportRequest);

    WeekMonthReportEidtResponse weekMonthReportEidtToWeekMonthReportEidtResponse(WeekMonthReportEidt weekMonthReportEidt);

    WeekMonthReportEidt progressReportToWeekMonthReportEidt(ProgressReportEntity progressReport);

    List<OneAndKeyAndMilestoneTaskList> oneKeyMilestonesToOneAndKeyAndMilestoneTaskList(List<ProgressReportDetailEntity> oneTasks);

    List<OneAndKeyAndMilestoneTaskListResponse> weekMonthReportEidtToOneAndKeyAndMilestoneTaskListResponse(List<OneAndKeyAndMilestoneTaskList> oneTaskList);

    List<MilestoneDetailResponse> progressReportDetailEntityToMilestoneDetailResponse(List<ProgressReportDetailEntity> milestoneList);

    List<TaskListResponse> progressReportDetailEntityToTaskListResponse(List<ProgressReportDetailEntity> firstList);

    ProgressReportMonthDetailResponse progressReportEntityToProgressReportMonthDetailResponse(ProgressReportEntity progressReportEntityList);

    ProcessTaskListRequest processListQueryToProcessTaskListRequest(ProcessListQuery processListQuery);

    List<ProcessTask> processTaskResponseListToProcessTaskList(List<ProcessTaskResponse> processTaskList);

    List<ProgressProcessResponse> progressTaskToProcessTaskResponse(List<ProcessTask> processList);

    WeekMonthReportEidt weekMonthReportEidtSaveRequestToWeekMonthReportEidt(WeekMonthReportEidtSaveRequest weekMonthReportEidtSaveRequest);

    ProgressReportEntity weekMonthReportEidtToProgressReportEntity(WeekMonthReportEidt weekMonthReportEidt);

    WeekMonthReportEidt progressReportEntityToWeekMonthReportEidt(ProgressReportEntity progressReportEntity);

    ProgressReportWeekDetailResponse progressReportEntityToProgressReportWeekDetailResponse(ProgressReportEntity progressReportEntityList);

    ProjectAttachmentImageEntity mToProjectAttachmentImageEntity(ProgressAttachmentImageEntity m);

    WeekMonthReportType weekMonthReportEidtSaveRequestToWeekMonthReportType(WeekMonthReportTypeRequest weekMonthReportEidtSaveRequest);

    MonthReportCreate monthReportCreateRequestToMonthReportCreate(MonthReportCreateRequest monthReportCreateRequest);

    WeekMonthReportEidt monthReportCreateToWeekMonthReportEidt(MonthReportCreate monthReportCreate);

    ProgressReportEntity monthReportCreateToProgressReportEntity(MonthReportCreate monthReportCreate);

    ProgressReportDetailEntity pogressDetailToProgressReportDetailEntity(ProgressDetailEntity pogressDetail);

    ProgressReport weekMonthReportEidtQueryToProgressReport(WeekMonthReportEidt weekMonthReportEidtQuery);

    ProjectBriefListQuery projectBriefListRequestToProjectBriefListQuery(ProjectBriefListRequest projectBriefListRequest);

    PaginationData<ProjectBriefListResponse> projectBriefReportListToProjectBriefListResponseList(Page<ProjectBriefReport> projectBriefReportList);

    MessagesSendRequest messagesSendPostCommandToMessagesSendRequest(MessagesSendPostCommand messagesSendPostCommand);
    
    Page<ProjectBriefReport> projectBriefReportEntitiesToprojectBriefReports(Page<ProjectBriefReportEntity> projectBriefReportEntities);

    ProjectBriefReportDetailQuery projectBriefReportDetailRequestToProjectBriefReportDetailQuery(ProjectBriefReportDetailRequest projectBriefReportDetailRequest);

    ProjectBriefReportDetailAllResponse projectBriefReportDetailsToProjectBriefReportDetailResponses(ProjectBriefReportVo projectBriefReportVo);

    List<ProjectBriefReportDetail> projectBriefReportDetailEntitiesToProjectBriefReportDetails(List<ProjectBriefReportDetailEntity> projectBriefReportDetailEntities);

    List<ProjectBriefReportDetailEntity> projectBriefReportEditCommandToProjectBriefReportDetailEntity(List<ProjectBriefReportEditCommand> projectBriefReportEditCommand);

    ProgressReportExportQuery progressReportExportRequestToProgressReportExportQuery(ProgressReportExportRequest progressReportExportRequest);

    ProjectBriefReportDetailQuery projectBriefReportExportRequestToProjectBriefReportDetailQuery(ProjectBriefReportExportRequest projectBriefReportExportRequest);

    VersionManageListQuery versionManageRequestToVersionManageQuery(VersionManageRequest versionManageRequest);

    ProgressReportDetailEntity oneAndKeyAndMilestoneTaskListToV(OneAndKeyAndMilestoneTaskList v);

    ProgressAttachmentImageEntity vToProgressAttachmentImageEntity(ProjectAttachmentImageEntity v);

    List<ProjectBriefReportDetail> projectBriefReportEditCommandToProjectBriefReportDetail(List<ProjectBriefReportEditCommand> projectBriefReportEditCommand);

    ProjectBriefReportEditAllCommand projectBriefReportEditRequestToProjectBriefReportEditCommand(ProjectBriefReportAllRequest projectBriefReportEditRequest);

    ProjectResponse projectOneToProjectResponse(ProjectOne projectOne);

    ProjectAttachmentImageEntity mdToProjectAttachmentImageEntity(ProjectAttachmentImageEntity m);

    ProgressAttachmentImageEntity mwToProgressAttachmentImageEntity(ProgressAttachmentImageEntity m);

    List<ProgressProcessResponse> processTasksToProgressProcessResponse(List<ProcessTask> processTasks);

    ConstructionLogListQuery constructionLogListRequestToConstructionLogListQuery(ConstructionLogListRequest constructionLogListRequest);

    Page<ConstructionLog> constructionLogEntityPageToConstructionLog(Page<ConstructionLogEntity> constructionLogEntityPage);

    PaginationData<ConstructionLogListResponse> constructionLogListToConstructionLogListResponse(Page<ConstructionLog> constructionLogList);

    ConstructionLogDetailQuery constructionlogdetailrequestToConstructionLogDetailQuery(ConstructionLogDetailRequest constructionlogdetailrequest);

    ConstructionLogDetailResponse constructionLogDetailToConstructionLogDetailResponse(ConstructionLogDetail constructionLogDetail);

    ConstructionLogQuery constructionLogRequestToConstructionLogQuery(ConstructionLogRequest constructionLogRequest);

    List<ConstructionLogResponse> constructionLogWeatherToConstructionLogResponse(List<ConstructionLogWeather> constructionLogWeather);

    List<ConstructionLogContent> constructionLogDetailEntitiesToconstructionLogContent(List<ConstructionLogDetailEntity> constructionLogDetailEntities);

    ConstructionLogSaveAndDraft constructionlogdetailrequestToConstructionLogSaveAndDraft(ConstructionLogSaveAndDraftRequest constructionlogdetailrequest);

    ConstructionLogEntity constructionLogSaveAndDraftToConstructionLogEntity(ConstructionLogSaveAndDraft constructionLogSaveAndDraft);

    List<ConstructionLogDetailEntity> constructionLogContentsToConstructionLogDetailEntity(List<ConstructionLogContent> constructionLogContents);

    ConstructionLogListQuery constructionLogAPPListRequestToConstructionLogListQuery(ConstructionLogListAppRequest constructionloglistapprequest);

    ConstructionLog constructionLogEntityOneToConstructionLog(ConstructionLogEntity constructionLogEntity);

    ConstructionLogSaveAndDraft constructionLogsToConstructionLogSaveAndDraft(ConstructionLogEntity constructionLogs);

    ConstructionLogSaveAndDraft constructionLogEntityToConstructionLogSaveAndDraft(ConstructionLogEntity constructionLogEntity);

    QueryListTaskRecordRequest queryListTaskRecordCommandToQueryListTaskRecordRequest(QueryListTaskRecordCommand queryListTaskRecordCommand);

    ConstructionLogListAppResponse constructionLogListToConstructionLogListAppResponse(ConstructionLog constructionLog);

    EngineeringReportQuery engineeringReportListPcRequestToEngineeringReportQuery(EngineeringReportListPcRequest engineeringReportListPcRequest);

    PaginationData<EngineeringReportResponse> engineeringWeekMonthReportToEngineeringReportResponse(Page<EngineeringWeekMonthReport> engineeringWeekMonthReport);

    Page<EngineeringWeekMonthReport> engineeringWeekMonthReportEntityPageToEngineeringWeekMonthReportPage(Page<EngineeringWeekMonthReportEntity> engineeringWeekMonthReportEntityPage);

    EngineeringReportQuery engineeringReportListAppRequestToEngineeringReportQuery(EngineeringReportListAppRequest engineeringReportListAppRequest);

    ConstructionLogDownloadQuery constructionlogdownloadRequestToConstructionLogDownloadQuery(ConstructionLogDownloadRequest constructionlogdownloadRequest);

    EngineeringReportDetailQuery engineeringReportDetailRequestToEngineeringReportDetailQuery(EngineeringReportDetailRequest engineeringReportDetailRequest);

    EngineeringReportDetailResponse engineeringReportDetail(EngineeringReportDetail engineeringReportDetail);

    List<EngineeringConstructionCompletionEntity> progressReportDetailEntitysToEngineeringConstructionCompletionEntity(List<ProgressReportDetailEntity> progressReportDetailEntitys);

    List<EngineeringCompletionAttachmentImageEntity> progressImagesToEngineeringCompletionAttachmentImageEntity(List<ProgressAttachmentImageEntity> progressImages);

    List<EngineeringCompletionAttachmentImageEntity> projrctImagesToEngineeringCompletionAttachmentImageEntity(List<ProjectAttachmentImageEntity> projrctImages);

    List<EngineeringConstructionCompletionEntity> oneProgressDetailsToEngineeringConstructionCompletionEntity(List<ProgressDetailEntity> oneProgressDetails);

    @Mapping(source = "name", target = "oneTaskName")
    EngineeringConstructionCompletionEntity pdToEngineeringConstructionCompletionEntity(ProgressReportDetailEntity pd);

    @Mapping(source = "name", target = "oneTaskName")
    EngineeringConstructionCompletionEntity oneTatkToEngineeringConstructionCompletionEntity(ProgressDetailEntity oneTatk);

    EngineeringReportOneQuery engineeringWeekMonthReportEntityToEngineeringReportOneQuery(EngineeringWeekMonthReportEntity engineeringWeekMonthReportEntity);

    List<EngineeringConstructionCompletion> engineeringConstructionCompletionEntitiesToEngineeringConstructionCompletion(List<EngineeringConstructionCompletionEntity> engineeringConstructionCompletionEntities);

    List<EngineeringImportantNodePlan> engineeringImportantNodePlanEntitiesToEngineeringImportantNodePlan(List<EngineeringImportantNodePlanEntity> engineeringImportantNodePlanEntities);

    EngineeringReportDetail engineeringWeekMonthReportEntityToEngineeringReportDetail(EngineeringWeekMonthReportEntity engineeringWeekMonthReportEntity);

    List<EngineeringConstructionCompletionExport> engineeringConstructionCompletionsToEngineeringConstructionCompletionsExport(List<EngineeringConstructionCompletion> engineeringConstructionCompletions);

    EngineeringWeekMonthReportEntity engineerReportToEngineeringWeekMonthReportEntity(EngineeringReportOneQuery engineerReport);

    ProgressReviewProjectCommand engineeringReportBackRequestToProgressReviewProjectCommand(EngineeringReportBackRequest engineeringReportBackRequest);

    EngineeringWeekMonthReportSave engineeringReportListRequestToEngineeringWeekMonthReportSave(EngineeringReportListRequest engineeringReportListRequest);

    EngineeringWeekMonthReportEntity engineeringSaveAndDraftToEngineeringWeekMonthReportEntity(EngineeringWeekMonthReportSave engineeringSaveAndDraft);

    OrganizationOneQueryRequest organizationQueryToOrganizationOneQueryRequest(OrganizationQuery organizationQuery);

    OrganizationListQueryRequest organizationQueryToOrganizationListQueryRequest(OrganizationQuery organizationQuery);

    EngineeringConstructionCompletionEntity engineeringConstructionCompletionsToEngineeringConstructionCompletionEntity(EngineeringConstructionCompletionSave engineeringConstructionCompletions);

    EngineeringReportOneQueryResponse engineeringReportOneQueryResponseToEngineeringReportOneQuery(EngineeringReportOneQuery engineeringReportOneQuery);

    EngineeringWeekMonthReportSave engineeringWeekMonthReportToEngineeringWeekMonthReportSave(EngineeringWeekMonthReportEntity engineeringWeekMonthReport);

    ConstructionLogDetailQuery constructionLogExportRequestToConstructionLogDetailQuery(ConstructionLogExportRequest constructionlogdetailrequest);

    List<PersonDetailResp> personDetailRespToPerson(List<PersonDetailResp> personDetailList);


    List<AttachmentResponse>  attachmentResp(List<AttachmentEntity> attachmentEntities);
}
